//  @ Project : GagalPanen
//  @ File Name : player.cpp
//  @ Date : 3/9/2011
//  @ Author : 
//
//


#include "player.hpp"
#include "playerconstants.hpp"

Player::Player(GameInterface* game) :
    MovingCreature(game,
        game->getMaps()->getField()->getCellAt(
            PlayerConstants::playerStartLocationXCoordinate(),
            PlayerConstants::playerStartLocationYCoordinate())) {
}

Player::Player(GameInterface* game, std::ifstream& is) :
    MovingCreature(game, is) {
}

void Player::save(std::ofstream& os) {
  MovingCreature::save(os);
}

Player::~Player() {

}

void Player::advanceDay() {
  resetPosition();
  return;
}

void Player::advanceTime() {
  return;
}

bool Player::isInHouse() {
  return game_->getMaps()->getHouse()->containsCell(getCell());
}

void Player::resetPosition() {
  cell_ =
  game_->getMaps()->getField()->getCellAt(
            PlayerConstants::playerStartLocationXCoordinate(),
            PlayerConstants::playerStartLocationYCoordinate());
  return;
}

bool Player::isSteppable() {
  return false;
}
